package cn.com.blueInfo.bpm.person.convert;

import cn.com.blueInfo.bpm.common.convert.BaseConvert;
import cn.com.blueInfo.bpm.person.entity.Post;
import cn.com.blueInfo.bpm.person.request.PostDTO;
import cn.com.blueInfo.bpm.person.response.PostVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 岗位与组织关系表 对象转换
 * @author suxch
 * @since 2025-08-31 16:18:02
 */
@Mapper(componentModel = "spring")
public interface PostConvert
        extends BaseConvert<Post, PostDTO, PostVO> {

    Post dtoToEntity(PostDTO dto);

    Post dtoToEntity(PostDTO.UpdatePartialDTO dto);

    @Mapping(source = "status", target = "status", qualifiedByName = "enumToDesc")
    @Mapping(source = "deleted", target = "deleted", qualifiedByName = "enumToDesc")
    PostVO entityToVO(Post entity);

}